using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.Content;

namespace Xfinity.Dice
{
    public struct Die
    {
        public Die(byte sides)
        {
            this.sides = sides;
        }
        private static Random random = new Random();
        public int Roll(int numberOfRolls, int modifier)
        {
            int count = 0;
            for (int i = 0; i < numberOfRolls; i++)
            {
                count += random.Next(1, sides + 1);
            }
            count += modifier;
            return count;
        }
        public int Roll(int numberOfRolls)
        {
            return Roll(numberOfRolls, 0);
        }
        #region Sides
        private byte sides;

        /// <summary>
        /// Sides.
        /// </summary>
        public byte Sides
        {
            get { return sides; }
            set { sides = value; }
        }

        #endregion
    }
}
